home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / dos / dos_intern.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  2.9 KB  |  133 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: dos_intern.h,v 1.3 1996/09/11 12:57:32 digulla Exp $
  4.     $Log: dos_intern.h,v $
  5.     Revision 1.3  1996/09/11 12:57:32  digulla
  6.     Pattern support by M. Fleischer
  7.  
  8.     Revision 1.2  1996/08/01 17:40:49  digulla
  9.     Added standard header for all files
  10.  
  11.     Desc:
  12.     Lang:
  13. */
  14. #ifndef DOS_INTERN_H
  15. #define DOS_INTERN_H
  16.  
  17. #include <dos/dosextens.h>
  18. #include <dos/filesystem.h>
  19.  
  20. #ifdef SysBase
  21. #undef SysBase
  22. #endif
  23. #define SysBase (DOSBase->dl_SysBase)
  24. #ifdef UtilityBase
  25. #undef UtilityBase
  26. #endif
  27. #define UtilityBase (DOSBase->dl_UtilityBase)
  28.  
  29. /* Needed for close() */
  30. #define expunge() \
  31. __AROS_LC0(BPTR, expunge, struct DosLibrary *, DOSBase, 3, Dos)
  32.  
  33. struct DAList
  34. {
  35.     STRPTR *ArgBuf;
  36.     UBYTE *StrBuf;
  37.     STRPTR *MultVec;
  38. };
  39.  
  40. struct EString
  41. {
  42.     LONG Number;
  43.     STRPTR String;
  44. };
  45.  
  46. extern struct EString EString[];
  47.  
  48. #ifndef EOF
  49. #define EOF -1
  50. #endif
  51. #ifndef IOBUFSIZE
  52. #define IOBUFSIZE 4096
  53. #endif
  54.  
  55. struct vfp
  56. {
  57.     BPTR file;
  58.     LONG count;
  59. };
  60.  
  61. #define FPUTC(f,c) \
  62. (((struct FileHandle *)BADDR(f))->fh_Flags&FHF_WRITE&& \
  63.  ((struct FileHandle *)BADDR(f))->fh_Pos<((struct FileHandle *)BADDR(f))->fh_End? \
  64. *((struct FileHandle *)BADDR(f))->fh_Pos++=c,0:FPutC(f,c))
  65.  
  66. LONG DoName(struct IOFileSys *iofs, STRPTR name);
  67.  
  68. struct marker
  69. {
  70.     UBYTE type; /* 0: Split 1: MP_NOT */
  71.     STRPTR pat;    /* Pointer into pattern */
  72.     STRPTR str;    /* Pointer into string */
  73. };
  74.  
  75. struct markerarray
  76. {
  77.     struct markerarray *next;
  78.     struct markerarray *prev;
  79.     struct marker marker[128];
  80. };
  81.  
  82. #define PUSH(t,p,s)                            \
  83. {                                    \
  84.     if(macnt==128)                            \
  85.     {                                    \
  86.         if(macur->next==NULL)                        \
  87.         {                                \
  88.             macur->next=AllocMem(sizeof(struct markerarray),MEMF_ANY);    \
  89.             if(macur->next==NULL)                    \
  90.                 ERROR(ERROR_NO_FREE_STORE);                \
  91.             macur->next->prev=macur;                    \
  92.         }                                \
  93.         macur=macur->next;                        \
  94.         macnt=0;                            \
  95.     }                                    \
  96.     macur->marker[macnt].type=(t);                    \
  97.     macur->marker[macnt].pat=(p);                    \
  98.     macur->marker[macnt].str=(s);                    \
  99.     macnt++;                                \
  100. }
  101.  
  102. #define POP(t,p,s)            \
  103. {                    \
  104.     macnt--;                \
  105.     if(macnt<0)                \
  106.     {                    \
  107.         macnt=127;            \
  108.         macur=macur->prev;        \
  109.         if(macur==NULL)            \
  110.             ERROR(0);            \
  111.     }                    \
  112.     (t)=macur->marker[macnt].type;    \
  113.     (p)=macur->marker[macnt].pat;    \
  114.     (s)=macur->marker[macnt].str;    \
  115. }
  116.  
  117. #define MP_ESCAPE    0x81 /* Before characters in [0x81;0x8a] */
  118. #define MP_MULT        0x82 /* _#(_a) */
  119. #define MP_MULT_END    0x83 /* #(a_)_ */
  120. #define MP_NOT        0x84 /* _~(_a) */
  121. #define MP_NOT_END    0x85 /* ~(a_)_ */
  122. #define MP_OR        0x86 /* _(_a|b) */
  123. #define MP_OR_NEXT    0x87 /* (a_|_b) */
  124. #define MP_OR_END    0x88 /* (a|b_)_ */
  125. #define MP_SINGLE    0x89 /* ? */
  126. #define MP_ALL        0x8a /* #? or * */
  127. #define MP_SET        0x8b /* _[_ad-g] */
  128. #define MP_NOT_SET    0x8c /* _[~_ad-g] */
  129. #define MP_DASH        0x8d /* [ad_-g_] */
  130. #define MP_SET_END    0x8e /* [ad-g_]_ */
  131.  
  132. #endif
  133.